package quality.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import quality.modelo.Empleado;
import quality.negocio.GestionEmpleado;

@WebServlet("/ServletEmpleado")
public class ServletEmpleado extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public ServletEmpleado() {
		super();

	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		String operacion = request.getParameter("operacion");
		RequestDispatcher rd;

		GestionEmpleado gEmpleado = new GestionEmpleado();

		// ########### LOGIN
		if (operacion.equals("login")) {

			try {
				
				Empleado empleado = new Empleado();
				
				String codigo = request.getParameter("txtCodigo");
				
				

			} catch (Exception e) {
				e.printStackTrace();
				String msg = "Login Incorrecto";
				request.setAttribute("mensaje", msg);
				rd = request.getRequestDispatcher("loginProveedor.jsp");
			}
			rd.forward(request, response);
		}
	}

}
